Skip to content

fix: no SMTP enable var#22

Merged
BretRen merged 2 commits intomainfrom
fix/env-var
Apr 20, 2026
Merged

fix: no SMTP enable var#22
BretRen merged 2 commits intomainfrom
fix/env-var

Conversation

@BretRen
Copy link
Copy Markdown
Member

@BretRen BretRen commented Apr 20, 2026

Summary by CodeRabbit

  • New Features
    • SMTP can now be enabled or disabled through environment configuration, providing greater flexibility in email delivery settings management.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@BretRen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 14 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 14 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b2eeef1-ee51-4913-8c35-29d7be6fbe89

📥 Commits

Reviewing files that changed from the base of the PR and between c34fbb1 and e9f4ce3.

📒 Files selected for processing (2)
  • .env.example
  • config.go
📝 Walkthrough

Walkthrough

The changes add a new optional SMTP_ENABLE environment variable to control SMTP functionality at runtime. The configuration system now reads this flag and conditionally sets the SMTP enablement state during setup.

Changes

Cohort / File(s) Summary
SMTP Feature Flag
.env.example, config.go
Added SMTP_ENABLE environment variable and integrated it into the SMTP configuration setup to allow toggling SMTP functionality via environment configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A hop through the configs, a flag we install,
SMTP_ENABLE—the simplest of all!
One line, one toggle, our mail now takes flight,
Feature-flagged features! Everything's right! ✨📧

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: no SMTP enable var' is unclear and does not accurately describe the changeset. The PR adds an SMTP_ENABLE environment variable feature, not removes one. Revise the title to accurately reflect the change, such as 'feat: add SMTP_ENABLE environment variable' or 'add SMTP_ENABLE toggle configuration'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/env-var

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new configuration flag to enable or disable SMTP functionality. The feedback suggests renaming the environment variable from SMTP_ENABLE to ENABLE_SMTP to ensure consistency with existing naming conventions for feature toggles in the project.

Comment thread .env.example Outdated
Comment thread config.go Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
config.go (1)

75-75: LGTM — resolves the missing SMTP enable toggle.

Wiring SMTP_ENABLE to settings.SMTP.Enabled via setBoolIfPresent is consistent with the other feature toggles (e.g., ENABLE_RATE_LIMITS, ENABLE_S3) and matches the .env.example addition.

Minor nit (optional): the naming is slightly inconsistent with other boolean toggles in this file, which use the ENABLE_* prefix (ENABLE_RATE_LIMITS, ENABLE_BATCH_API, ENABLE_S3, ENABLE_SMTP_TLS). Consider ENABLE_SMTP for consistency — but only if you're willing to accept the naming churn.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config.go` at line 75, The env var was added as "SMTP_ENABLE" but other
booleans use the ENABLE_* convention; if you want consistency rename the
variable to "ENABLE_SMTP": update the call setBoolIfPresent("SMTP_ENABLE",
&settings.SMTP.Enabled) to setBoolIfPresent("ENABLE_SMTP",
&settings.SMTP.Enabled), and then update any other references and the
.env.example entry accordingly (search for "SMTP_ENABLE" to replace). Ensure
setBoolIfPresent and settings.SMTP.Enabled remain unchanged except for the env
var string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@config.go`:
- Line 75: The env var was added as "SMTP_ENABLE" but other booleans use the
ENABLE_* convention; if you want consistency rename the variable to
"ENABLE_SMTP": update the call setBoolIfPresent("SMTP_ENABLE",
&settings.SMTP.Enabled) to setBoolIfPresent("ENABLE_SMTP",
&settings.SMTP.Enabled), and then update any other references and the
.env.example entry accordingly (search for "SMTP_ENABLE" to replace). Ensure
setBoolIfPresent and settings.SMTP.Enabled remain unchanged except for the env
var string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 05ec1dcf-d80f-4399-8f1d-4fa58d304f82

📥 Commits

Reviewing files that changed from the base of the PR and between 48cea01 and c34fbb1.

📒 Files selected for processing (2)
  • .env.example
  • config.go

@BretRen BretRen merged commit 93752d0 into main Apr 20, 2026
1 check passed
@BretRen BretRen deleted the fix/env-var branch April 20, 2026 01:25
@BretRen BretRen linked an issue Apr 20, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some env setting is not seting.

1 participant